﻿//-----------------------------------------------------------------------
// <copyright file="Enumerations.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------

namespace GateShift.Common.DataPackets.Authentication
{
    /// <summary>
    /// Enumeration for all Server Authorization Service Codes
    /// </summary>
    public enum ServerAuthCode : byte
    {
        /// <summary>
        /// Server code to request a check for username X
        /// </summary>
        UserNameRequestPacket = 1,

        /// <summary>
        /// Server code to request a login for username X
        /// </summary>
        LoginRequestPacket = 2,

        /// <summary>
        /// Server code to request a token renewal
        /// </summary>
        TokenRenewalRequestPacket = 3,

        /// <summary>
        /// Server code to request a logout
        /// </summary>
        LogoutRequestPacket = 4
    }

    /// <summary>
    /// Enumeration for all Client Authorization Service Codes
    /// </summary>
    public enum ClientAuthCode : byte
    {
        /// <summary>
        /// Client code to respond to a username request
        /// </summary>
        UserNameResponsePacket = 0,

        /// <summary>
        /// Client code to respond to a login or token renewal
        /// </summary>
        ValidationResponsePacket = 1,

        /// <summary>
        /// Client code to respond to a logout
        /// </summary>
        LogoutResponsePacket = 2
    }

    /// <summary>
    /// Response code for the ClientUserNameResponsePacket
    /// </summary>
    public enum ClientUserNameResponseCode : byte
    {
        /// <summary>
        /// No issues were found during the authentication process
        /// </summary>
        Success = 0,

        /// <summary>
        /// User was not found or was supplied incorrectly
        /// </summary>
        InvalidUser = 1,

        /// <summary>
        /// User is not allowed to log in at this time do to a locked account
        /// </summary>
        LockedUser = 2,

        /// <summary>
        /// User is not allowed to log in at this time do to a banned account
        /// </summary>
        BannedUser = 3
    }

    /// <summary>
    /// Response code for the ClientValidationResponsePacket
    /// </summary>
    public enum ClientValidationResponseCode : byte
    {
        /// <summary>
        /// No issues were found with the password. Continue
        /// </summary>
        Success = 0,

        /// <summary>
        /// Dynamic Hash supplied incorrectly
        /// </summary>
        InvalidHash = 1,

        /// <summary>
        /// Packet recieved out of order. No authentication session active.
        /// </summary>
        RequestUserNameFirst = 2,

        /// <summary>
        /// User is not allowed to log in at this time
        /// </summary>
        LockedUser = 3
    }

    /// <summary>
    /// Reson codes for a client being logged out on the server
    /// </summary>
    public enum ClientLogoutResponseCode : byte
    {
        /// <summary>
        /// Game Master requested the logout
        /// </summary>
        AdministrativeGeneral = 0,

        /// <summary>
        /// A Game Master has banned this account
        /// </summary>
        AdministrativeBanned = 1,

        /// <summary>
        /// A Game Master has kicked this account offline
        /// </summary>
        AdministrativeKicked = 2,

        /// <summary>
        /// Client requested the logout
        /// </summary>
        ClientRequested = 10,

        /// <summary>
        /// System requested the logout
        /// </summary>
        SystemRequested = 20,
    }
}
